package cn.jobstart.service;

import cn.jobstart.modelExt.RightsExt;
import cn.jobstart.pubInter.IBaseService;
import cn.jobstart.pubInter.exception.SkException;
import cn.jobstart.modelExt.AdminExt;
import cn.jobstart.searchExt.AdminSearchExt;

import java.util.List;

/**
 * @author sunke
 * @Date 2023-09-06 15:00:20
 * @description AdminService      系统用户
 */
public interface IAdminService extends IBaseService<AdminExt, AdminSearchExt, String> {


    /**
     *  检测员工是否还可以订阅
     * @param adminId
     * @return
     */
    boolean canSubscriptionByAdminId(String adminId);

    /**
     *  更新已启用任务
     * @param adminId
     * @throws SkException
     */
    void  addRunSubscriptionTask(String adminId) throws SkException;

    /**
     * 减少
     * @param adminId
     * @throws SkException
     */
    void  reduceRunSubscriptionTask(String adminId) throws SkException;





    /**
     * 用户登录
     *
     * @param username
     * @param password
     * @return
     * @throws SkException
     */
    AdminExt loginByUsernameAndPsw(String username, String password) throws SkException;


    /**
     * 根据用户名得到员工详情
     *
     * @param username
     * @return
     */
    AdminExt getInfoByUsername(String username);

    /**
     * 根据手机号码查询
     *
     * @param phone
     * @return
     */
    AdminExt getInfoByPhone(String phone);


    List<RightsExt> getAllRightsListByStaffId(String staffId, boolean cache);

    /**
     * 得到一个所有权限
     *
     * @param staffId
     * @return
     */
    List<String> getAllRightsIdsByStaffId(String staffId);

    /**
     * 删除某一个人的缓存权限
     *
     * @param staffId
     */
    void clearRightsByStaffId(String staffId);


}